﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lamex.mNC.Calculate
{
    public class AL_MAIN
    {
        /// <summary>
        /// MAIN_HEAD
        /// </summary>
        /// <param name="DWGNO">图纸号</param>
        /// <param name="PARTNO">部件号</param>
        /// <param name="NOSECODE">机头代码</param>
        /// <param name="QTY">加工数量</param>
        /// <returns></returns>
        public static string GET_AL_MAIN_HEAD(string DWGNO, string PARTNO, string NOSECODE, string QTY)
        {
            StringBuilder str = new StringBuilder("%");           
            str.Append("\r\n");
            str.Append("O0000");
            str.Append("\r\n");
            str.Append("");
            str.Append("\r\n");
            str.Append("(MAIN_HEAD)");
            str.Append("\r\n");
            str.Append("(PROGRAMNAME_" + DWGNO + "_" + PARTNO + "_" + NOSECODE + "_" + QTY + ")");
            str.Append("\r\n");       
            str.Append("G21");
            str.Append("\r\n");
            str.Append("G00G17G40G49G80G90");
            str.Append("\r\n");
            str.Append("(MAIN_HEAD)");
            str.Append("\r\n");
            str.Append("");
            str.Append("\r\n");
            return str.ToString();
        }

        public static string GET_AL_MAIN_END()
        {
            StringBuilder str = new StringBuilder("(MAIN_END)");
            str.Append("\r\n");
            str.Append("M09");
            str.Append("\r\n");
            str.Append("M05");
            str.Append("\r\n");
            str.Append("G00G91G28Z0.");
            str.Append("\r\n");
            str.Append("G00G91G28Y0.");
            str.Append("\r\n");
            str.Append("(MAIN_END)");         
            str.Append("\r\n");
            str.Append("");
            str.Append("\r\n");
            str.Append("M30");
            str.Append("\r\n");
            str.Append("%");
            str.Append("\r\n");       
            return str.ToString();
        }
    }
}
